﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GeneticAlgorithms.Genomes;

namespace GeneticAlgorithms.Factories
{
    /// <summary>
    /// Factory for bitarray genomes.
    /// </summary>
    public class BinaryGenomeFactory : IGenomeFactory<BinaryGenome>
    {
        /// <summary>
        /// Gets the length of the genomes that will be created.
        /// </summary>
        /// <value>
        /// A 32-bit integer value representing the length for the 
        /// new genomes.
        /// </value>
        public int GenomeLength { get; private set; }

        /// <summary>
        /// Initializes a new instance of the <see cref="BinaryGenomeFactory"/> class.
        /// </summary>
        /// <param name="genomeLength">Length of the genome.</param>
        public BinaryGenomeFactory(int genomeLength)
        {
            GenomeLength = genomeLength;
        }

        #region IGenomeFactory<BinaryGenome> Members

        /// <summary>
        /// Creates a genome.
        /// </summary>
        /// <returns>A new genome object.</returns>
        public BinaryGenome CreateGenome()
        {
            return new BinaryGenome(GenomeLength);
        }

        #endregion
    }
}
